package pointer

import "fmt"

func Test() {
	var x int = 100
	var a *int = &x
	fmt.Println(x, *a)
	fmt.Println(a, &x)

	var y int = 200
	a = &y
	fmt.Println(y, *a)
	fmt.Println(&x, &y, a)

	var n *int
	fmt.Println(n) // <nil>
	defer fmt.Println("执行完成")
	fmt.Println(*n) // panic: runtime error: invalid memory address or nil pointer dereference

}
